package com.tengju.bff.interfaces.manage.crm.dashborad.assembler;

import com.google.common.collect.Lists;
import com.tengju.bff.interfaces.app.domination.vo.StarLevelNumVO;
import com.tengju.bff.interfaces.shared.KVVO;
import com.tengju.data.domain.model.clickhouse.star.DominationMemberNew;
import com.tengju.data.domain.model.user.StarLevelEnum;

import java.util.List;
import java.util.Optional;

public class DashboardDominationTeamAssembler {

    public static List<KVVO> assemblerToVO(DominationMemberNew dominationMemberNew) {
        List<KVVO> starLevelNumVOList = Lists.newArrayList();
        starLevelNumVOList.add(KVVO.of(StarLevelEnum.NONE.getDesc(),
                Optional.ofNullable(dominationMemberNew).map(DominationMemberNew::getNewDealerNum).orElse(0)));
        starLevelNumVOList.add(KVVO.of(StarLevelEnum.CITY_STAR_ONE.getDesc(),
                Optional.ofNullable(dominationMemberNew).map(DominationMemberNew::getNewCityStarOneNum).orElse(0)));
        starLevelNumVOList.add(KVVO.of(StarLevelEnum.CITY_STAR_TWO.getDesc(),
                Optional.ofNullable(dominationMemberNew).map(DominationMemberNew::getNewCityStarTwoNum).orElse(0)));
        starLevelNumVOList.add(KVVO.of(StarLevelEnum.CITY_STAR_THREE.getDesc(),
                Optional.ofNullable(dominationMemberNew).map(DominationMemberNew::getNewCityStarThreeNum).orElse(0)));
        starLevelNumVOList.add(KVVO.of(StarLevelEnum.CITY_STAR_FOUR.getDesc(),
                Optional.ofNullable(dominationMemberNew).map(DominationMemberNew::getNewCityStarFourNum).orElse(0)));
        starLevelNumVOList.add(KVVO.of(StarLevelEnum.EC.getDesc(),
                Optional.ofNullable(dominationMemberNew).map(DominationMemberNew::getNewEcNum).orElse(0)));
        return starLevelNumVOList;
    }

}
